import Cookie from "./Cookie";
export default{
    CheckLogin() {
        this.GetUserID();
    },

    GetPhone(){
        let phone=Cookie.getCookie("phone");
        this.Redirect2Login(phone);
        return phone;
    },

    GetUserID(skip=false){
        let userID=Cookie.getCookie("userID");
        this.Redirect2Login(userID,skip);
        return userID;
    },

    GetUserName(){
        let userName=Cookie.getCookie("userName");
        this.Redirect2Login(userName);
        return userName;
    },

    Redirect2Login(value,skip=false){
        if(""===value && !skip){
            document.location="/login";
        }
    },

    GetUserHeadUrl(){
        let userHeadUrl=Cookie.getCookie("userHeadUrl");
        this.Redirect2Login(userHeadUrl);
        return userHeadUrl;
    },
};